home *** CD-ROM | disk | FTP | other *** search
- Subject: Microsoft QuickBASIC 4.0 Introduces "Instant" Programming
- Date: Fri Oct 16 14:22:54 1987
-
- REDMOND, WA -- OCTOBER 23, 1987 -- Microsoft Corporation today announced
- Microsoft(R) QuickBASIC Version 4.0, a combined compiler-debugger-interpreter
- that is so fast, the company is calling it an "Instant Environment." Microsoft
- QuickBASIC 4.0 boasts speeds of up to 150,000 lines per minute, program
- modification and debugging without recompilation, an editor that checks syntax
- as you type, and instantaneous command testing.
- Based on revolutionary language technology, QuickBASIC 4.0 is actually a
- "threaded p-code interpreter" which offers the speed of a compiler and the
- interactiveness of an interpreter. This technology incorporates users' changes
- to their programs at an incredible 150,000 lines per minute (Speed
- measurements based on an 8 MHz PC-AT).
- Microsoft QuickBASIC 4.0 comes fully integrated with a subset of
- Microsoft's CodeView(TM) debugger, offers multiple module programming support,
- many powerful enhancements to the BASIC language, and a multi-file/window
- editor that supports WordStar(R) commands.
- Microsoft's product manager for languages, Rob Dickerson said, "Microsoft
- QuickBASIC 4.0 is more than a new language. It's a new language processing
- system that combines the speed of a compiler with the interactiveness of an
- interpreter. Most operations happen so fast they appear to be instantaneous.
- Because the functionality of Microsoft QuickBASIC 4.0 has never been available
- before in a PC-based BASIC, we've coined a new phrase for it: Instant
- Environment. It represents nothing short of a revolution in programming."
-
- Instant Results
- The most important feature of Microsoft QuickBASIC 4.0 is its speed: the
- speed of a compiler, the interactiveness of an interpreter. If a program is
- interrupted and changed, Microsoft QuickBASIC 4.0 incorporates changes at
- 150,000 lines per minute (Speed measurements based on an 8 MHz PC-AT). There
- is no perceptible delay from the point of view of the user, who simply
- stops the program, makes changes, and continues execution without delay.
- Additional Microsoft QuickBASIC 4.0 "instant" features include:
-
- 1. Edit and Continue. Interrupt your running program, make changes to it,
- and in most cases you can continue running instantly from where you left off,
- with all of your data values intact.
- 2. Total memory availability. All machine memory is available
- for programming.
- 3. Instant syntax checking. As soon as a line of code is entered, it is
- checked for correct syntax.
- 4. Instant command testing. A single line of BASIC code can be tested
- instantly through an immediate window.
-
- Instant Debugging
- Microsoft QuickBASIC 4.0 comes fully integrated with a subset
- of Microsoft's CodeView debugger, which provides powerful source
- code debugging. One function key initiates debugging, with no delay, at
- any time during program development.
- Breakpoints can be set and cleared at any statement, "watch" points can be
- used to conditionally break when expressions become true, and "watch"
- expressions display the value of variables while the program is running.
- Expressions can be as simple as a single variable or can refer to procedures
- written in BASIC or other Microsoft languages, allowing programs to break on
- complex state changes.
-
- In addition to breakpoints and "watch" expressions, Microsoft QuickBASIC
- 4.0 provides a number of other mechanisms for facilitating program control
- during debugging:
-
- Animated trace
- Single stepping forward with history
- Procedure stepping
- Stack tracing
- Procedure and COMMON block type checking
-
- Mixed Language Programming
- As a member of Microsoft's family of inter-callable languages, Microsoft
- QuickBASIC 4.0 allows the user to invoke code written in any other Microsoft
- language such as Microsoft C 5.0, QuickC(TM), MASM 5.0, Pascal 3.32, or
- Fortran 4.01. Mixed-language programs can be debugged at the source code level
- using CodeView.
-
- Instant Help
- Microsoft QuickBASIC 4.0 provides context-sensitive help for all keywords
- in the language, and for all operations in the instant environment. The user
- simply places the cursor near the keyword and with the touch of a function key
- sees the syntax of the statement.
-
- Instant EXE and Library Creation
- Microsoft QuickBASIC 4.0 expedites EXE and library creation
- with menu-selectable options. The selection "Make EXE" causes an EXE to
- be generated automatically. EXEs can run stand-alone or rely on a
- run-time file.
- Similarly for libraries, the selection "Make Library" creates both a
- QuickLibrary (the QB4 version of the QB3 library) and a regular library in a
- single operation. The Microsoft QuickBASIC 4.0 linker allows the user to
- create libraries written in other Microsoft languages.
-
- Multiple Module Programming Is Now Pain-Free
- Microsoft QuickBASIC 4.0 adds structure to BASIC programming
- by accommodating multiple modules in memory at the same time. The QuickBASIC
- windowing environment allows the user to view and edit one or two of the
- modules simultaneously in separate windows. In addition, the user can browse
- an indented list of modules and procedures with the Program Outliner. The
- Program Outliner also allows SUBs and FUNCTIONs to be deleted or moved from
- one module to another. Between development sessions, QuickBASIC 4.0
- automatically saves and loads all related modules.
- SUB and FUNCTION references support full type checking between modules,
- preventing program breakage at run-time due to incorrect argument passing.
-
- Powerful BASIC Enhancements
- Microsoft QuickBASIC 4.0 includes a powerful set of enhancements to the
- BASIC language that make it more appealing to both business users and
- professional programmers. Some of the key enhancements are:
-
- 1. Record support. Microsoft QuickBASIC 4.0 now supports user-defined
- types or "records" that simplify random file I/O and make programs easy to
- understand.
- 2. Recursion. Microsoft QuickBASIC 4.0 is the first version of Microsoft
- BASIC to support recursive SUBs and FUNCTIONs.
- 3. FUNCTIONs. Microsoft QuickBASIC 4.0 is the first Microsoft BASIC to
- support true functions.
- 4. Arrays. Microsoft QuickBASIC 4.0 now supports arrays larger than 64K as
- a command line option.
- 5. Array index ranges. The Microsoft QuickBASIC 4.0 index range is -32768
- to 32767, with the ability to declare lower bounds for arrays other than 0 or
- 1.
- 6. Long integers. A four-byte integer data type has been added.
- 7. Multi-language interface. A new DECLARE statement allows Microsoft
- QuickBASIC 4.0 to call programs written in other Microsoft languages as well
- as providing type checking for BASIC procedure calls.
-
- Binary File I/O
- To make it easier to interface to business application software such as
- dBASE III(R) or Lotus(R) 1-2-3(R), Microsoft has added binary file I/O
- capability to Microsoft QuickBASIC 4.0. Specifically, three statements have
- been enhanced -- OPEN, GET and PUT -- to allow access to a file at the byte
- level. A new statement, SEEK, has been added to provide direct access to any
- part of a file. Binary file I/O allows reading and writing any BASIC variable
- (including records) to any byte position in a file.
-
- Hercules Graphics
- QuickBASIC 4.0 now supports the Hercules(TM) graphics adapters. This
- includes support for the Hercules Graphics Card, the Graphics Card Plus, as
- well as the InColor Card.
- Implemented with an enhanced SCREEN statement, this support gives 720 X 348
- pixel resolution graphics with two screen pages on systems with a Hercules
- card installed.
-
- Microsoft QuickBASIC 4.0 Pricing, Availability
- The new Microsoft QuickBASIC 4.0 compiler is available now at all Microsoft
- retail outlets. It has a suggested retail price of $99, which Microsoft is
- complementing with a 30-day no-risk, money-back guarantee. Upgrade pricing is
- $25 for 3.0 owners and $35 for owners of versions prior to 3.0.
- Minimum system requirements for Microsoft QuickBASIC 4.0 are an IBM(R)
- Personal Computer or compatible with 320K of memory, MS-DOS 2.1 or higher, and
- one double-sided disk drive. Microsoft recommends two disk drives.
-
- For more information about either the product or the demo disk, contact
- Microsoft's Customer Service Department at 206/882-8080 (in Washington state),
- or write to Microsoft's Customer Service Department at Box 97017, Redmond,
- Washington 98073-9717.
-
- Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a wide
- range of software for business and professional use, including operating
- systems, languages and application programs as well as books and hardware for
- the microcomputer marketplace.
-
- Microsoft and the Microsoft logo are registered trademarks and QuickC and
- CodeView are trademarks of Microsoft Corporation.
- IBM is a registered trademark of International Business
- Machines Corporation.
- dBASE III is a registered trademark of Ashton-Tate Corporation.
- Lotus and 1-2-3 are registered trademarks of Lotus
- Development Corporation.
- WordStar is a registered trademark of MicroPro International.
- Hercules is a trademark of Hercules Computer Technology.
-
- Type Declarations and Record Structures
-
- QuickBASIC Version 4.0 adds support for User Definable Types and Record
- Structures. An example might look like:
-
- TYPE PersonName
- Last AS STRING * 15
- First AS STRING * 15
- MiddleInit AS String * 1
- SocSecNum AS LONG
- END TYPE
-
- Record Variable Declarations
-
- Using the type we defined in the above example, an example declaration might
- look like:
-
- DIM PersonTable(50) as PersonName
-
- Random I/O
-
- The FIELD statement is no longer required for RANDOM I/O -- you can PUT and
- GET a record to a RANDOM file. For example:
-
- PUT #1,10,PersonTable(10)
-
- Recursion
- QuickBASIC 4.0 now supports recursive SUBs and FUNCTIONs.
-
- FUNCTIONs
- QuickBASIC V4.0 now supports FUNCTIONs. FUNCTIONs differ from DEF FNs in
- that FUNCTIONs may have local static and dynamic variables and are public to
- other modules. They can also be recursive. FUNCTIONs are similar to SUBs
- except that they return a value.
-
- Binary File I/O
- QuickBASIC 4.0 now supports a new file access mode known as Binary File
- I/O. This is implemented via enhancements to the OPEN, GET, and PUT
- statements. Binary File I/O allows the program to operate on files on a byte
- level.
-
- Keywords for Mixed-Language Calling
- QuickBASIC 4.0 now has special keywords CDECL and BYVAL to support mixed
- language programming with other Microsoft languages, including Macro Assembler
- 5.0, Quick C 1.0, C Compiler 5.0, and FORTRAN 4.0.
-
- Miscellaneous Language Enhancements
- Long Integers: QuickBASIC 4.0 now supports a 4-byte Integer data type.
- Array Index Ranges: QuickBASIC 4.0 now supports lower bounds for arrays to
- be in the range -32768 to 32767.
- UCASE$ & LCASE$: Translates the given string to upper and lower case
- respectively.
-
- QuickBASIC 4.0 is the latest in Microsoft's line of user-friendly
- compilers. Or is it? In QB4 you can always run your code without waiting for
- compilation. You can always debug. You can test out statements just by typing
- them in. You can even interrupt your program while it's running, change a line
- (or three) and pick up where you left off--with your data intact. Sounds too
- user friendly to be a compiler!
-
- Is It an Interpreter?
- QB4 executes your programs in memory much faster than BASICA ever did. In
- fact, your programs will run almost as fast inside QB4 as they will when you
- make them into separate EXEs. Now how could an interpreter do that?
-
- We Compile in Order to Interpret: Threaded P-Code
- The answer to this riddle is that we compile your programs to a form that's
- about 90 percent along the way to real native machine code--it's called
- threaded p-code. Since threaded p-code looks almost like the output of a
- compiler, it runs almost as fast as you would expect an EXE to run. But it
- retains enough information--the crucial last bits that machine code loses--to
- allow us to list it to the screen in source code format, and to modify it if
- you decide to make changes. For the first time you can run, debug, and edit
- your program as much as you want with virtually no speed penalty!
- Since threaded p-code isn't quite ready for the CPU to execute, we have to
- provide an interpreter to execute it. We aren't willing to give up much
- execution speed, however, so we've done our best to make the interpreter small
- and fast. We'll give away a secret and show you the threaded p-code
- interpreter:
-
- LODSW ES
- JMP AX
-
- This isn't a mistake. Our threaded p-code interpreter consists wholly of two
- assembly code instructions, occupying a total of 4 bytes and taking 7 CPU
- cycles to execute. That's all of it.
-
- The Threaded P-Code Interpreter
- OK, that's not quite the whole story. Threaded p-code interpretation works
- like this: each BASIC statement is translated from source code form into
- threaded p-code, which is made up of a series of executor addresses. Executor
- addresses are simply the addresses in memory of the routines or executors that
- perform the tasks necessary to execute a BASIC statement, such as "PRINT" (to
- print a value to the screen) or "+" (to add two integers).
- The LODSW instruction in the interpreter simply loads AX with the next
- executor address from threaded p-code, and JMP AX transfers control to the
- executor that performs the task. Instead of returning from the executor with a
- wasteful RET instruction (remember that we JMP'd, not CALL'd to it), the same
- two interpreter instructions LODSW and JMP are tacked onto the end of each
- executor, so we "thread" our way from task to task with virtually no
- performance overhead.
-
- "Instant" Program Changes: a Three-State Machine
- There's one difficulty with the threaded p-code scenario: while threaded
- p-code retains enough information to allow the re-creation of your source code
- from the executor addresses and their data, this process takes time. And
- recompiling back to threaded p-code after you edit your program takes more
- time.
- We wanted QB4 to really be "instant," however, so we took a hard look at
- which of the translation tasks were time-consuming and which were quick, and
- realized that we could save you time by creating an intermediate program
- format (which we call a "state") between editable code and threaded p-code.
- This left us with three states, which we call PARSED, symbolic, and threaded.
-
- PARSED
- When you load a program into QB4 from disk, or type in a new program, QB4
- immediately translates your BASIC statements into a format called PARSED. As
- the name implies, most syntax checking is done at this time. Any time you make
- a large-scale change to your program, such as adding several new COMMON data
- declarations, QB4 automatically translates your program back to the PARSED
- state.
-
- SYMBOLIC
- When you run a newly-loaded or typed program for the first time, QB4
- prepares to interpret it by translating it from the PARSED to the SYMBOLIC
- state. The lion's share of this work is the creation of a symbol table that
- allows QB4 to easily access the data in your program.
-
- THREADED
- QB4's final step toward preparing your program for running is to translate
- the actual operations that your program performs into executor addresses. QB4
- does this immediately after it has completed the change from PARSED to
- SYMBOLIC.
-
- An In-Depth Look at QB4's State Changes
- Exactly how do these state changes occur while you're developing a program?
- As we mentioned above, when you run your program for the first time, we
- translate it from the editable PARSED to the intermediate SYMBOLIC state. The
- major task that we perform in changing from PARSED to SYMBOLIC is to generate
- a symbol table for all of your data so we can easily locate data items during
- program execution. In fact, this symbol table is virtually identical to the
- efficient symbol tables that compilers generate for fast data access.
-
- Immediately following the PARSED to SYMBOLIC change is the move from
- SYMBOLIC to THREADED. This entails inserting type - checking code, binding
- procedure calls, control structures and labels to actual memory locations,
- linking COMMON data, and of course generating the executor addresses that
- characterize threaded p-code. By now your program is running, and since the
- complete PARSED-SYMBOLIC-THREADED state change proceeds at about 60,000 (60K)
- lines/minute (on an IBM PC AT at 8 megahertz), you won't have waited as long
- for this "compile" as you would in QuickBASIC 3.0--and you'll have waited
- 1/10th the time that our competitors take.
- Of course, if you change your program while it is running, we have to back
- up or "de-scan" a part of it--as small a part as a single SUB or FUNCTION most
- of the time. Since the de-scan from THREADED to SYMBOLIC is lightning fast and
- doesn't disrupt your program's data (allowing you to "edit and continue") we
- try to limit all de-scan changes from THREADED to SYMBOLIC rather than all the
- way back to PARSED. And for most changes we can do this. In fact, there are
- only a few types of edits you can make to your program that will take you back
- to PARSED--notably, changes to COMMON, SHARED or DEF type (such as DEFINT)
- statements. Most other edits allow you to continue running after the
- ultra-fast state change from THREADED to SYMBOLIC and back. It's the 150,000
- (150K) line/minute rate of this change that lets us call QB4 "instant."
-
- Think about the implications of this for a moment. For the first time ever,
- you are always ready to run or debug your programs. You might wonder, "Hasn't
- QB4 just moved the task of compilation to occur before I edit my program,
- rather than after?" Although that's true, how many times do you recompile a
- program before you've got it working just the way you want it to? When you add
- all of those compile delays up, you start to see how QB4 really lets you
- cruise. Add in the time that you used to spend getting back to the point in
- your program where you discovered a bug (instead of simply fixing the bug and
- continuing execution), and you're light years ahead with QB4.
-
- Single Representation Means Bigger Programs
- It's important to realize that, unlike previous QuickBASICs or our
- competitors, we always maintain your program in only one state at a time in
- memory. That means you never use double the memory that your program
- needs--once for the program's source code and once for it's compiled
- instructions--so we avoid the painful situation of being able to edit a
- program but not being able to compile it.
-
- QuickLibraries and Interlanguage Calling
- There is a caveat to this view of the QB4 world: QuickLibraries (QB4's
- easy-to-use replacement for UserLibraries in QB3) are made up of actual
- machine code, which is why you can't list them even if you've loaded them in
- QB4. There are two huge advantages of using QuickLibraries. First,
- QuickLibraries are the very fastest executing code objects in QB4 memory, so
- they are perfect for well-tested subs and functions. Second, QuickLibraries
- can hold code written in any Microsoft language, so they are the gateway to
- easy interlanguage calling from QuickBASIC to C, MASM, FORTRAN, or Pascal.
- Just tell the linker to generate a QuickLibrary and you're ready to go.
-
- QB4: The Instant Environment
- It's not a compiler and it's not an interpreter. Threaded p-code makes QB4
- an instant environment. You're always ready to run, you're always ready to
- debug, you can test statements on the fly, and you're never drumming your
- fingers waiting for a long compile after you make that last teensy change to
- your program. Benefits like these are a step into the future.
-
-